import request from '@/utils/request'

class QuestionnaireApi {
  query(data) {
    return request({
      url: '/questionnaire/list',
      method: 'get',
      data
    })
  }

  queryByCond(data, pageSize, pageNum) {
    return request({
      url: `/questionnaire/queryByCond?pageSize=${pageSize}&pageNum=${pageNum}`,
      method: 'post',
      data
    })
  }
  add(data) {
    return request({
      url: '/questionnaire/add',
      method: 'post',
      data
    })
  }
  importExcelData(data) {
    return request({
      url: '/questionnaire/importExcelData',
      method: 'post',
      data
    })
  }
  update(data) {
    return request({
      url: '/questionnaire/update',
      method: 'post',
      data
    })
  }
  delete(data) {
    return request({
      url: '/questionnaire/delete',
      method: 'post',
      data
    })
  }
  exportWord(data) {
    return request({
      url: '/questionnaire/exportWord',
      method: 'get',
      params:data,
      responseType: 'blob',
    })
  }
  excelData(data) {
    return request({
      url: '/excel/data',
      method: 'POST',
      data
    })
  }
  excelExport(data) {
    return request({
      url: '/excel/export',
      method: 'POST',
      data,
      responseType: 'blob',
    })
  }
  excelDeptStats(data) {
    return request({
      url: '/excel/dept-stats',
      method: 'POST',
      data
    })
  }
  selCountDistrict() {
    return request({
      url: '/excel/selCountDistrict',
      method: 'get',
    })
  }
  ///excel/selCountDistrict
  ///excel/dept-stats
}

export default new QuestionnaireApi()
